package com.example.cim.config;

import com.example.cim.handler.CIMRequestHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Auther: 郭敬仰
 * @Date: 2019/5/24 15:39
 * @Description:
 */
@Component
public class ChannelHandlerFactory {
    @Autowired
    private  Map<String, CIMRequestHandler> channelHandlerMap;

    public CIMRequestHandler getChannelHandler(String channelType) {
        CIMRequestHandler channelHandler = channelHandlerMap.get(channelType);
        if (channelHandler == null) {
            return null;
        }
        return channelHandler;
    }
}
